package com.link.gateway.core.comproperty;


/**
 * @author Guoshan
 * @date 2019-07-22 10:45
 * token相关的常量以及线程安全变量
 */

public class TokenConstants {
    /**
     * 内部不拦截请求的请求头名称
     */
    public static final String NO_INTERCEPT_FLAG_NAME = "NoIntercept";

    /**
     * 内部不拦截请求的请求头的值
     */
    public static final String NO_INTERCEPT_FLAG_VALUE = "NoIntercept";

    /**
     * 请求头中添加的内部token标识
     */
    public static final String INNER_TOKEN = "INNERTOKEN";

    /**
     * 内部token json字符串中存储用户信息的key
     */
    public static final String USER_KEY = "user";

    /**
     * 内部token json字符串中存储用户企业信息的key
     */
    public static final String ENTERPRISE = "enterprise";

    public static final String ACCESS_TOKEN_FIELD = "access_token";
    public static final String TOKEN_SCOPE = "token_scope";
    public static final String TOKEN_PREFIX = "auth_user_";
    public static final String LOGIN_INFO_PREFIX = "login_info_";

    /**
     * url详细信息key
     */
    public static final String ALL_URL_DETAIL_CACHE_KEY = "allUrlDetailCacheKey";

    /**
     * url范围信息key
     */
    public static final String ALL_URL_SCOPE_CACHE_KEY = "allUrlScopeCacheKey";

    /**
     * url范围信息key
     */
    public static final String ALL_DUTY_USERNAME_CACHE_KEY = "allDutyUsernameCacheKey";

    /**
     * url范围信息key
     */
    public static final String ALL_DUTY_URL_CACHE_KEY = "allDutyURLCacheKey";

    /**
     * 默认url key
     */
    public static final String ALL_DEFAULT_URL_CACHE_KEY = "allDefaultUrlCacheKey";

    /**
     * 页面认证头名称
     */
    public static final String AUTH_HEADER_NAME   = "Authorization";

    /**
     * API认证头名称
     */
    public static final String API_AUTH_HEADER_NAME = "APIAuthorization";

    /**
     * 未知请求类型
     */
    public static final String UNKNOWN_REQ_TYPE = "unknowReqType";


    /**
     * 所有url
     */
    public static final String ALL_URL_REDIS_KEY = "ALL_URL_REDIS_KEY";

    /**
     * 在api公钥模式下，用来标识自定义token的键
     */
    public static final String CUSTOM_TOKEN_KEY = "customToken";

    /**
     * api公钥模式下存储用户json字符串信息的key
     */
    public static final String USER_JSON_KEY = "userJson";

    /**
     * api公钥模式下存储用户企业json字符串信息的key
     */
    public static final String ENTERPRISE_JSON_KEY = "enterpriseJson";


    public static final String ALL_APP_DUTY_USERNAME_CACHE_KEY = "allAppDutyUsernameCacheKey";
    public static final String ALL_APP_DUTY_URL_CACHE_KEY = "allAppDutyURLCacheKey";

}
